home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 1.0 / CIncludes / iostream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  19.2 KB  |  783 lines  |  [TEXT/MPS ]

  1. /*
  2.  *------------------------------------------------------------------------
  3.  * Copyright:
  4.  *      © 1993 by Apple Computer Inc.   All rights reserved.
  5.  *
  6.  * Project:
  7.  *      PowerPC C++ Streams Library
  8.  *
  9.  * Filename:
  10.  *      iostream.h
  11.  *
  12.  * Created:
  13.  *      (unknown)
  14.  *
  15.  * Modified:
  16.  *      Date     Engineer       Comment
  17.  *      -------- -------------- ------------------------------------------
  18.  *      12/01/93 Rudy Wang      Removed the declaration of "static Iostream_init iostream_init;"
  19.  *                              and placed it inside iostream_init.c so that we don't get multiple
  20.  *                              copies of this static object all over the place.
  21.  *      12/17/93 Rudy Wang      Made this file universal.
  22.  *------------------------------------------------------------------------
  23.  */
  24.  
  25. #ifndef __IOSTREAMH__
  26. #define __IOSTREAMH__       1
  27.  
  28. // include string.h - Some inlines use memcpy
  29. #include <string.h>
  30.  
  31. #ifdef EOF
  32. #if EOF != -1
  33. #undef EOF
  34. #define EOF (-1)
  35. #endif
  36. #else
  37. #define EOF (-1)
  38. #endif
  39.  
  40. #ifndef NULL
  41. #define NULL 0
  42. #endif
  43.  
  44. #define zapeof(c)       ((c) & 0377)
  45.  
  46. typedef long streampos;
  47. typedef long streamoff;
  48.  
  49. #ifdef powerc
  50. #pragma options align=power
  51. #endif
  52.  
  53. #ifdef powerc
  54. /*
  55.  * removed from ios.c and placed here to avoid forward reference problem - rjd 921223
  56.  */
  57. union ios_user_union
  58. {
  59.     long i_word;
  60.     void *p_word;
  61. };
  62. #endif
  63.  
  64. class streambuf;
  65. class ostream;
  66.  
  67. class ios
  68. {
  69.  
  70. public:
  71.     /*
  72.      * Some enums are declared in ios to avoid pollution of global namespace
  73.      */
  74.     enum io_state
  75.     {
  76.         goodbit  = 0,
  77.         eofbit   = 1,
  78.         failbit  = 2,
  79.         badbit   = 4,
  80.         hardfail = 0200
  81.     };
  82.     /*
  83.      * hard fail can be set and reset internally, but not via public function
  84.      */
  85.     enum open_mode
  86.     {
  87.         in        =    1,
  88.         out       =    2,
  89.         ate       =    4,
  90.         app       =  010,
  91.         trunc     =  020,
  92.         nocreate  =  040,
  93.         noreplace = 0100
  94.     };
  95.     enum seek_dir
  96.     {
  97.         beg = 0,
  98.         cur = 1,
  99.         end = 2
  100.     };
  101.     /*
  102.      * flags for controlling format
  103.      */
  104.     enum
  105.     {
  106.         skipws     =     01,        // skip whitespace on input
  107.  
  108.         left       =     02,        // padding location
  109.         right      =     04,
  110.         internal   =    010,
  111.  
  112.         dec        =    020,        // conversion base
  113.         oct        =    040,
  114.         hex        =   0100,
  115.  
  116.         showbase   =   0200,        // modifiers
  117.         showpoint  =   0400,
  118.         uppercase  =  01000,
  119.         showpos    =  02000,
  120.  
  121.         scientific =  04000,        // floating point notation
  122.         fixed      = 010000,
  123.  
  124.         unitbuf    = 020000,        // stuff to control flushing
  125.         stdio      = 040000
  126.     };
  127.     static const long basefield;    // = dec | oct | hex
  128.     static const long adjustfield;  // = left | right | internal
  129.     static const long floatfield;   // = scientific | fixed
  130.  
  131. public:
  132.     ios(streambuf*);
  133.     virtual ~ios();
  134.  
  135.     long flags() const          { return x_flags; }
  136.     long flags(long f);
  137.  
  138.     long setf(long setbits, long field);
  139.     long setf(long);
  140.     long unsetf(long);
  141.  
  142.     int  width() const          { return x_width; }
  143.     int  width(int w)           { int i = x_width; x_width = w; return i; }
  144.  
  145.     int  precision(int);
  146.     int  precision() const      { return x_precision; }
  147.  
  148.     char fill(char);
  149.     char fill() const           { return x_fill; }
  150.     ostream* tie(ostream* s);
  151.     ostream* tie()              { return x_tie; }
  152.  
  153.     operator void*()            { return (state & (failbit | badbit | hardfail)) ? NULL : this; }
  154. #ifdef powerc
  155.     operator const void*() const{ return (state & (failbit | badbit | hardfail)) ? NULL : this; }
  156. #endif
  157.     int operator!() const       { return state & (failbit | badbit | hardfail); }
  158.     int rdstate() const         { return state; }
  159.     int eof() const             { return state & eofbit; }
  160.     int fail() const            { return state & (failbit | badbit | hardfail); }
  161.     int bad() const             { return state & badbit; }
  162.     int good() const            { return state == 0; }
  163.     void clear(int i = 0)
  164.     {
  165.         state =  (i & 0377) | (state & hardfail);
  166.         ispecial = (ispecial & ~0377) | state;
  167.         ospecial = (ospecial & ~0377) | state;
  168.     }
  169.     streambuf* rdbuf()          { return bp; }
  170.  
  171. public:
  172.     /*
  173.      * Members related to user allocated bits and words
  174.      */
  175.     long& iword(int);
  176.     void*& pword(int);
  177.     static long bitalloc();
  178.     static int xalloc();
  179.  
  180. private:
  181.     static long nextbit;
  182.     static long nextword;
  183.  
  184.     int nuser;
  185.     union ios_user_union* x_user;
  186.     void uresize(int);
  187.  
  188. public:
  189.     /*
  190.      * static member functions
  191.      */
  192.     static void sync_with_stdio();
  193.  
  194. protected:
  195.     enum
  196.     {
  197.         skipping = 01000,
  198.         tied     = 02000
  199.     };
  200.     /*
  201.      * bits 0377 are reserved for userbits
  202.      */
  203.     streambuf* bp;
  204.     void setstate(int b)
  205.     {
  206.         state |= (b & 0377);
  207.         ispecial |= b & ~skipping;
  208.         ispecial |= b;
  209.     }
  210.     int         state;
  211.     int         ispecial;
  212.     int         ospecial;
  213.     int         isfx_special;
  214.     int         osfx_special;
  215.     int         delbuf;
  216.     ostream*    x_tie;
  217.     long        x_flags;
  218.     short       x_precision;
  219.     char        x_fill;
  220.     short       x_width;
  221.  
  222.     static void (*stdioflush)();
  223.  
  224.     void init(streambuf*);      // Does the real work of a constructor.
  225.     ios();                      // No initialization at all.  Needed by multiple inheritance versions.
  226.     int assign_private;         // Needed by with_assgn classes.
  227.  
  228. private:
  229.     ios(ios&);                  // Declared but not defined
  230.     void operator=(ios&);       // Declared but not defined
  231.  
  232. public:
  233.     /*
  234.      * old stream package compatibility
  235.      */
  236.     int skip(int i);
  237.  
  238. };  // class ios
  239.  
  240.  
  241. class streambuf
  242. {
  243.  
  244. protected:
  245.     short       alloc;
  246.  
  247. private:
  248.     short       x_unbuf;
  249.     char*       x_base;
  250.     char*       x_pbase;
  251.     char*       x_pptr;
  252.     char*       x_epptr;
  253.     char*       x_gptr;
  254.     char*       x_egptr;
  255.     char*       x_eback;
  256.     int         x_blen;
  257.  
  258. private:
  259.     streambuf(streambuf&);      // Declared but not defined
  260.     void operator=(streambuf&); // Declared but not defined
  261.  
  262. public:
  263.     void dbp();
  264.  
  265. protected:
  266.     char*       base()          { return x_base; }
  267.     char*       pbase()         { return x_pbase; }
  268.     char*       pptr()          { return x_pptr; }
  269.     char*       epptr()         { return x_epptr; }
  270.     char*       gptr()          { return x_gptr; }
  271.     char*       egptr()         { return x_egptr; }
  272.     char*       eback()         { return x_eback; }
  273.     char*       ebuf()          { return x_base + x_blen; }
  274.     int         blen() const    { return x_blen; }
  275.     void        pbump(int n)    { x_pptr += n; }
  276.     void        gbump(int n)    { x_gptr += n; }
  277.     void setp(char* p, char* ep)
  278.     {
  279.         x_pbase = x_pptr = p;
  280.         x_epptr = ep;
  281.     }
  282.     void setg(char* eb, char* g, char* eg)
  283.     {
  284.         x_eback = eb;
  285.         x_gptr = g;
  286.         x_egptr = eg;
  287.     }
  288.     void setb(char* b, char* eb, int a = 0)
  289.     {
  290.         if (alloc && x_base)
  291.             delete x_base;
  292.         x_base = b;
  293.         x_blen = (eb > b) ? (eb - b) : 0;
  294.         alloc = a;
  295.     }
  296.     int unbuffered()            { return x_unbuf; }
  297.     void unbuffered(int unb)    { x_unbuf = (unb != 0); }
  298.     virtual int doallocate();
  299.     int allocate()              { return (x_base == 0 && !unbuffered()) ? doallocate() : 0; }
  300.  
  301. public:
  302.     virtual int overflow(int c = EOF);
  303.     virtual int underflow();
  304.     virtual int pbackfail(int c);
  305.     virtual int sync();
  306.     virtual streampos seekoff(streamoff, ios::seek_dir, int = ios::in | ios::out);
  307.     virtual streampos seekpos(streampos, int = ios::in | ios::out);
  308.     virtual int xsputn(const char* s, int n);
  309.     virtual int xsgetn(char* s, int n);
  310.  
  311.     int in_avail()
  312.     {
  313.         return (x_gptr < x_egptr) ? x_egptr - x_gptr : 0;
  314.     }
  315.     int out_waiting()
  316.     {
  317.         return (x_pptr) ? x_pptr - x_pbase : 0;
  318.     }
  319.     int sgetc()
  320.     {
  321.         /*
  322.          * WARNING: sgetc does not bump the pointer
  323.          */
  324.         return (x_gptr >= x_egptr) ? underflow() : zapeof(*x_gptr);
  325.     }
  326.     int snextc()
  327.     {
  328.         return (++x_gptr >= x_egptr) ? x_snextc() : zapeof(*x_gptr);
  329.     }
  330.     int sbumpc()
  331.     {
  332.         return (x_gptr >= x_egptr && underflow() == EOF) ? EOF : zapeof(*x_gptr++);
  333.     }
  334.     int optim_in_avail()
  335.     {
  336.         return x_gptr < x_egptr;
  337.     }
  338.     int optim_sbumpc()
  339.     {
  340.         return (underflow() == EOF) ? EOF : zapeof(*x_gptr++);
  341.     }
  342.     void stossc()
  343.     {
  344.         if (x_gptr++ > x_egptr)
  345.             underflow();
  346.     }
  347.     int sputbackc(char c)
  348.     {
  349.         if (x_gptr > x_eback)
  350.         {
  351.             if (*--x_gptr == c)
  352.                 return zapeof(c);
  353.             else
  354.                 return zapeof(*x_gptr = c);
  355.         }
  356.         else
  357.             return pbackfail(c);
  358.     }
  359.     int sputc(int c)
  360.     {
  361.         return (x_pptr >= x_epptr) ? overflow(zapeof(c)) : zapeof(*x_pptr++ = c);
  362.     }
  363.     int sputn(const char* s,int n)
  364.     {
  365.         if (n <= (x_epptr - x_pptr))
  366.         {
  367.             memcpy(x_pptr, s, n);
  368.             pbump(n);
  369.             return n;
  370.         }
  371.         else
  372.             return xsputn(s, n);
  373.     }
  374.     int sgetn(char* s,int n)
  375.     {
  376.         if (x_gptr + n <= x_egptr)
  377.         {
  378.             memcpy(s, x_gptr, n);
  379.             gbump(n);
  380.             return n;
  381.         }
  382.         else
  383.             return xsgetn(s, n);
  384.     }
  385.     virtual streambuf* setbuf(char* p, int len);
  386.     streambuf* setbuf(unsigned char* p, int len);
  387.     streambuf* setbuf(char* p, int len, int count);     // obsolete third argument
  388.     /*
  389.      * Constructors -- should be protected
  390.      */
  391.     streambuf();
  392.     streambuf(char* p, int l);
  393.     streambuf(char* p, int l, int c);                   // 3 argument form is obsolete. Use strstreambuf.
  394.     virtual ~streambuf();
  395.  
  396. private:
  397.     int x_snextc();
  398.  
  399. };  // class streambuf
  400.  
  401.  
  402. class istream : virtual public ios
  403. {
  404.  
  405. public:
  406.     /*
  407.      * Constructor, destructor
  408.      */
  409.     istream(streambuf*);
  410.     virtual ~istream();
  411.  
  412. public:
  413. #ifdef powerc
  414.     int         ipfx(int need);
  415. #else
  416. #ifdef applec
  417.     int         ipfx(int noskipws = 0)
  418.     {
  419.         return (noskipws ? (ispecial & ~skipping) : ispecial) ? do_ipfx(noskipws) : 1;
  420.     }
  421. #endif
  422. #endif
  423.     void        isfx()                                  { }
  424.     istream&    seekg(streampos p);
  425.     istream&    seekg(streamoff o, ios::seek_dir d);
  426.     streampos   tellg();
  427.     istream&    operator>>(istream& (*f)(istream&))     { return (*f)(*this); }
  428.     istream&    operator>>(ios& (*f)(ios&));
  429.     istream&    operator>>(char*);
  430.     istream&    operator>>(unsigned char*);
  431. #ifdef powerc
  432.     istream&    operator>>(unsigned char& c);
  433.     istream&    operator>>(char& c);
  434. #else
  435. #ifdef applec
  436.     istream&    operator>>(unsigned char& c)
  437.     {
  438.         if (!ispecial && bp->optim_in_avail())
  439.         {
  440.             c = bp->optim_sbumpc();
  441.             return *this;
  442.         }
  443.         else
  444.             return rs_complicated(c);
  445.     }
  446.     istream&    operator>>(char& c)
  447.     {
  448.         if (!ispecial && bp->optim_in_avail())
  449.         {
  450.             c = bp->optim_sbumpc();
  451.             return *this;
  452.         }
  453.         else
  454.             return rs_complicated(c);
  455.     }
  456.     istream&    rs_complicated(unsigned char& c);
  457.     istream&    rs_complicated(char& c);
  458. #endif
  459. #endif
  460.     istream&    operator>>(short&);
  461.     istream&    operator>>(int&);
  462.     istream&    operator>>(long&);
  463.     istream&    operator>>(unsigned short&);
  464.     istream&    operator>>(unsigned int&);
  465.     istream&    operator>>(unsigned long&);
  466.     istream&    operator>>(float&);
  467.     istream&    operator>>(double&);
  468. #ifdef powerc
  469.     istream&    operator>>(long double&);
  470. #else
  471. #ifdef applec
  472.     istream&    operator>>(extended&);
  473.     istream&    operator>>(comp&);
  474. #endif
  475. #endif
  476.     istream&    operator>>(streambuf*);
  477. #ifdef __xlC
  478.     istream&    get(char*,                int lim, char delim = '\015');
  479.     istream&    get(unsigned char* b,     int lim, char delim = '\015');
  480.     istream&    getline(char* b,          int lim, char delim = '\015');
  481.     istream&    getline(unsigned char* b, int lim, char delim = '\015');
  482.     istream&    get(streambuf& sb,                 char delim = '\015');
  483. #else
  484.     istream&    get(char*,                int lim, char delim = '\n');
  485.     istream&    get(unsigned char* b,     int lim, char delim = '\n');
  486.     istream&    getline(char* b,          int lim, char delim = '\n');
  487.     istream&    getline(unsigned char* b, int lim, char delim = '\n');
  488.     istream&    get(streambuf& sb,                 char delim = '\n');
  489. #endif
  490.     istream&    get_complicated(unsigned char& c);
  491.     istream&    get_complicated(char& c);
  492. #ifdef powerc
  493.     istream&    get(unsigned char& c);
  494.     istream&    get(char& c);
  495. #else
  496. #ifdef applec
  497.     istream&    get(unsigned char& c)
  498.     {
  499.         if (!(ispecial & ~skipping) && bp->optim_in_avail())
  500.         {
  501.             x_gcount = 1;
  502.             c = bp->sbumpc();
  503.             return *this;
  504.         }
  505.         else
  506.             return (get_complicated(c));
  507.     }
  508.     istream&    get(char& c)
  509.     {
  510.         if (!(ispecial & ~skipping) && bp->optim_in_avail())
  511.         {
  512.             x_gcount = 1;
  513.             c = bp->sbumpc();
  514.             return *this;
  515.         }
  516.         else
  517.             return (get_complicated(c));
  518.     }
  519. #endif
  520. #endif
  521.     int get()
  522.     {
  523.         int c;
  524.         if (!ipfx(1))
  525.             return EOF;
  526.         else
  527.         {
  528.             c = bp->sbumpc();
  529.             if (c == EOF)
  530.                 setstate(eofbit);
  531.             return c;
  532.         }
  533.     }
  534.     int         peek()                                  { return (ipfx(-1)) ? bp->sgetc() : EOF; }
  535.     istream&    ignore(int n = 1, int delim = EOF);
  536.     istream&    read(char* s,int n);
  537.     istream&    read(unsigned char* s,int n)            { return read((char*)s, n); }
  538.     istream&    putback(char c);
  539.     int         gcount();
  540.     int         sync()                                  { return bp->sync(); }
  541. #ifdef powerc
  542.     void        eatwhite();
  543. #endif
  544.  
  545. protected:
  546. #ifdef applec
  547.     void        eatwhite();
  548.     int         do_ipfx(int noskipws);
  549. #endif
  550.     istream();
  551.  
  552. private:
  553.     int         x_gcount;
  554.     void        xget(char*  c);
  555. #ifdef powerc
  556.     long        scan_int();
  557. #endif
  558.  
  559. #ifdef applec
  560. public:
  561.     /*
  562.      * Obsolete constructors, carried over from stream package.
  563.      */
  564.     istream(streambuf*, int sk, ostream* t = 0);        // obsolete, set sk and tie via format state variables
  565.     istream(int size, char*, int sk = 1);               // obsolete, use strstream
  566.     istream(int fd, int sk = 1, ostream* t = 0);        // obsolete, use fstream
  567. #endif
  568.  
  569. };  // class istream
  570.  
  571.  
  572. class ostream : virtual public ios
  573. {
  574.  
  575. public:
  576.     /*
  577.      * Constructor, destructor
  578.      */
  579.     ostream(streambuf*);
  580.     virtual ~ostream();
  581.  
  582. public:
  583. #ifdef powerc
  584.     int         opfx();         /* Output prefix */
  585.     void        osfx();
  586. #else
  587. #ifdef applec
  588.     int         opfx()                                  { return (ospecial) ? do_opfx() : 1; }
  589.     void        osfx()                                  { if (osfx_special) do_osfx(); }
  590. #endif
  591. #endif
  592.     ostream&    flush();
  593.     ostream&    seekp(streampos p);
  594.     ostream&    seekp(streamoff o, ios::seek_dir d);
  595.     streampos   tellp();
  596.     ostream&    put(char c);
  597. #ifdef powerc
  598.     ostream&    operator<<(char c);
  599.     ostream&    operator<<(unsigned char c);
  600. #else
  601. #ifdef applec
  602.     ostream&    complicated_put(char c);
  603.     ostream&    ls_complicated(char c);
  604.     ostream&    ls_complicated(unsigned char c);
  605.     ostream&    operator<<(char c)
  606.     {
  607.         if (ospecial || osfx_special)
  608.             return ls_complicated(c);
  609.         else
  610.         {
  611.             if (bp->sputc(c) == EOF)
  612.                 setstate(eofbit | failbit);
  613.             return *this;
  614.         }
  615.     }
  616.     ostream&    operator<<(unsigned char c)
  617.     {
  618.         if (ospecial || osfx_special)
  619.             return ls_complicated(c);
  620.         else
  621.         {
  622.             if (bp->sputc(c) == EOF)
  623.                 setstate(eofbit | failbit);
  624.             return *this;
  625.         }
  626.     }
  627. #endif
  628. #endif
  629.     ostream&    operator<<(const char*);
  630.     ostream&    operator<<(const unsigned char*);
  631.     ostream&    operator<<(int a);
  632.     ostream&    operator<<(long l);
  633. #ifdef powerc
  634.     ostream&    operator<<(float d)                     { return (*this) << (long double)d; }
  635.     ostream&    operator<<(double d)                    { return (*this) << (long double)d; }
  636.     ostream&    operator<<(long double d);
  637. #else
  638. #ifdef applec
  639.     ostream&    operator<<(float d)                     { return (*this) << (extended)d; }
  640.     ostream&    operator<<(double d)                    { return (*this) << (extended)d; }
  641.     ostream&    operator<<(extended d);
  642. #endif
  643. #endif
  644.     ostream&    operator<<(unsigned int a);
  645.     ostream&    operator<<(unsigned long l);
  646.     ostream&    operator<<(void*);
  647.     ostream&    operator<<(streambuf*);
  648.     ostream&    operator<<(short i)                     { return *this << (int)i; }
  649.     ostream&    operator<<(unsigned short i)            { return *this << (int)i; }
  650.     ostream&    operator<<(ostream& (*f)(ostream&))     { return (*f)(*this); }
  651.     ostream&    operator<<(ios& (*f)(ios&));
  652.     ostream&    write(const char* s, int n)
  653.     {
  654.         if (!state)
  655.         {
  656.             if (bp->sputn(s, n) != n)
  657.                 setstate(eofbit | failbit);
  658.         }
  659.         return *this;
  660.     }
  661.     ostream&    write(const unsigned char* s, int n)    { return write((const char*)s, n); }
  662.  
  663. protected:
  664. #ifdef applec
  665.     int         do_opfx();
  666.     void        do_osfx();
  667. #endif
  668.     ostream();
  669.  
  670. #ifdef applec
  671. public:
  672.     /*
  673.      * Obsolete constructors, carried over from stream package.
  674.      */
  675.     ostream(int fd);            // obsolete, use fstream.
  676.     ostream(int size, char*);   // obsolete, use strstream.
  677. #endif
  678.  
  679. };  // class ostream
  680.  
  681.  
  682. class iostream : public istream, public ostream
  683. {
  684.  
  685. public:
  686.     iostream(streambuf*);
  687.     virtual ~iostream();
  688.  
  689. protected:
  690.     iostream();
  691.  
  692. };  // class iostream
  693.  
  694.  
  695. class Iostream_init;
  696.  
  697. class istream_withassign : public istream
  698. {
  699.  
  700. public:
  701.     istream_withassign();
  702. #ifdef applec
  703.     istream_withassign(Iostream_init*);
  704. #endif
  705.     virtual ~istream_withassign();
  706.     istream_withassign& operator=(istream&);
  707.     istream_withassign& operator=(streambuf*);
  708.  
  709. };  // class istream_withassign
  710.  
  711.  
  712. class ostream_withassign : public ostream
  713. {
  714.  
  715. public:
  716.     ostream_withassign();
  717. #ifdef applec
  718.     ostream_withassign(Iostream_init*);
  719. #endif
  720.     virtual ~ostream_withassign();
  721.     ostream_withassign& operator=(ostream&);
  722.     ostream_withassign& operator=(streambuf*);
  723.  
  724. };  // class ostream_withassign
  725.  
  726.  
  727. class iostream_withassign : public iostream
  728. {
  729.  
  730. public:
  731.     iostream_withassign();
  732.     virtual ~iostream_withassign();
  733.     iostream_withassign& operator=(ios&);
  734.     iostream_withassign& operator=(streambuf*);
  735.  
  736. };  // class iostream_withassign
  737.  
  738.  
  739. extern istream_withassign cin;
  740. extern ostream_withassign cout;
  741. extern ostream_withassign cerr;
  742. #ifdef powerc
  743. extern ostream_withassign clog;
  744. #else
  745. #ifdef applec
  746. extern ostream_withassign cdebug;
  747. #endif
  748. #endif
  749.  
  750.  
  751. ios&            dec(ios&);
  752. ostream&        endl(ostream& i);
  753. ostream&        ends(ostream& i);
  754. ostream&        flush(ostream&);
  755. ios&            hex(ios&);
  756. ios&            oct(ios&);
  757. istream&        ws(istream&);
  758.  
  759.  
  760. /*
  761.  * see iostream_init.c (or MPW cstearms.c)
  762.  */
  763. class Iostream_init
  764. {
  765.  
  766.     static int stdstatus;
  767. #ifdef powerc
  768.     static int initcount;
  769. #endif
  770.     friend ios;
  771.  
  772. public:
  773.     Iostream_init();
  774.     ~Iostream_init();
  775.  
  776. };  // class Iostream_init
  777.  
  778. #ifdef powerc
  779. #pragma options align=reset
  780. #endif
  781.  
  782. #endif
  783.